HybridMail Technical - changeOptions
Updated: 09-12-2022 16:10

ChangeOptions XML attachment

The changeOptions attachment is used to set various properties of the letter based on its text content, e.g. You might want to set the postage class to first-class if the word 'urgent' is found in a specific part of the text

Schema

<mkzAttachment type="changeOptions">
	<onPreSubmit>
		<ignoreValidAddressCheck scan|identifier contains="text">true</ignoreValidAddressCheck>
		<ignoreOtherAddressCheck scan|identifier contains="text">true</ignoreOtherAddressCheck> 
		<discardLetter scan|identifier contains="text" >true</discardLetter>
	</onPreSubmit>
	
	<onSubmit>
		<letterClass [scan|identifier contains="text"] [valueIsIdentifier="true|false"]>first|second</letterClass> 
		<letterChroma [scan|identifier contains="text"] [valueIsIdentifier="true|false"]>colour|mono</letterChroma> 
		<letterPlex [scan|identifier contains="text"] [valueIsIdentifier="true|false"]>simplex|duplex</letterPlex> 
		<letterUser [scan|identifier contains="text"] [valueIsIdentifier="true|false"]>user-ID</letterUser> 
		<letterOutput [scan|identifier contains="text"] [valueIsIdentifier="true|false"]>output-ID</letterOutput> 
		<letterStatus [scan|identifier contains="text"] [valueIsIdentifier="true|false"]>status-name
			[<rejectionCode>code</rejectionCode>]
		</letterStatus>
		<letterDelivery [scan|identifier contains="text"] [valueIsIdentifier="true|false"]>postal|electronic</letterDelivery> 
		<letterName [scan|identifier] />
		<letterStream [scan|identifier] />
		<reselectOutput>true</reselectOutput>
		<appointmentDate scan|identifier changeClassDays="minval,maxval" dontSendDays="val"/> 
	</onSubmit>
</mkzAttachment>

The XML can be executed during the OnPreSubmit and OnSubmit phases.

 

The XML supports the following elements during OnPreSubmit. There can be only one instance of each of these

<ignoreValidAddressCheck>true</ignoreValidAddressCheck>  Override the check for address validity.

If this element if true, then the check for a valid address is ignored.

<ignoreOtherAddressCheck>true</ignoreOtherAddressCheck>  Override the check for addresses on subsequent pages.

If this element if true, then the check for other addresses (which might indicate a need to split the letter file into individual letters) is ignored.

<discardLetter>true</discardLetter>  Override the check for addresses on subsequent pages.

If this element if true, then all letter processing will be discontinued, the PDF file will be deleted and no database record will be created. This element is normally used to discard “heartbeat” messages. It should not be used for normal letter processing since all record of the letter’s existence is erased.
To prevent processing of a genuine letter, use the <letterStatus >rejected</letterStatus> element.

The XML supports the following elements during OnSubmit. There can be multiple instances of any of these.

<letterClass>Set the letter postage class.

Changes the letter class based on text in an identifier or scanned from the letter. Valid options are "first" or "second".

<letterChroma>Set the letter chroma (colour intensity).

Changes the letter chroma based on text in an identifier or scanned from the letter. Valid options are "colour" or "mono".

<letterPlex>Set the letter plex. (double/single sided)

Changes the letter plex based on text in an identifier or scanned from the letter. Valid options are "simplex" or "duplex".

<letterUser>Set the letter user (the user who submitted the letter).

Changes the ID of the sending user based on text in an identifier or scanned from the letter. Valid options are the integer ID of an existing user from the same organisation. You cannot change the User ID to that of a user from a different organisation.

<letterOutput>Set the letter output.

Changes the ID of the destination output queue based on text in an identifier or scanned from the letter. Valid options are the integer ID of an existing output.

<letterStatus>Set the status.

Changes the ID of the current letter processing status based on text in an identifier or scanned from the letter. Valid options are "pending", "queued", "deleted", "rejected" or "outputAssigned". The <rejectionCode> element is only valid for "rejected" status

<letterDelivery>Set the delivery method.

Changes the intended delivery method for the letter based on text in an identifier or scanned from the letter. Valid options are "electronic" and "postal".

<reselectOutput>true</reselectOutput>

Force Hybridmail to reselect the most appropriate output queue for this letter now that it has been modified.

An optional element, but should really be considered mandatory if any of the above elements change properties of the parent letter and the output has not been set to a known, appropriate value. Setting this to true causes the auto-assigned output queue to be recalculated based on changes that may have been made to the letter properties.

<appointmentDate changeClassDays="minval,maxval" dontSendDays="rejectval" > <appointmentDate>

If the text in an identifier or scanned from the letter contains a valid date, the number of working-days between "today" and the appointment date is calculated and compared with the values in the attributes.

If working-days is between minval and maxval (inclusive) then the letter is changed to first-class.
If working-days is less than or equal to rejectval then the letter is rejected and its status is set to Rejected:AppointmentTooSoon.

If the text in an identifier or scanned from the letter does not contain a valid date, no action is taken.

 

Examples

If the appointment is 10 working days ahead or less, change the letter to first class. However if the appointment is only 3 working days ahead or less, don't bother sending the letter at all.

<appointmentDate" scan="20,40,150,180" date="future" changeClassDays="4,10" dontSendDays="3" >

The following table assumes that the scanned date of the appointment is "Friday 18th July" and that, before processing this element, the letter was 'Queued' and 'Second-class'.

Date Letter Created
i.e. 'Today'
Working Days
until Appointment
Letter Status
after processing
Postal Class
after processing
Tues 1st July13QueuedSecond
Weds 2nd July12QueuedSecond
Thurs 3rd July11QueuedSecond
Fri 4th July10QueuedFirst
Sat 5th July9QueuedFirst
Sun 6th July9QueuedFirst
Mon 7th July9QueuedFirst
Tues 8th July8QueuedFirst
Weds 9th July7QueuedFirst
Thurs 10th July6QueuedFirst
Fri 11th July5QueuedFirst
Sat 12th July4QueuedFirst
Sun 13th July4QueuedFirst
Mon 14th July4QueuedFirst
Tues 15th July3RejectedN/A
Weds 16th July2RejectedN/A
Thurs 17th July1RejectedN/A
Fri 18th July0RejectedN/A